<%--
  Created by IntelliJ IDEA.
  User: 你
  Date: 2020/10/21
  Time: 7:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title
</head>
<body>
<%
    Class.forName("com.mysql.jdbc.Driver");
    String urL ="jdbc:mysql://Localhost:3306/book"; //数据库连接地址
    Connection connection = DriverManager.getConnection(url,"root" ,"root "); //第个root为数据库的用户名 第二个root为数据库的密码
    String sql="delete fron user where id = ?";
    PreparedStatement ps = connection. prepareStatement(sql);

    int id = Integer. parseInt(request.getParameter("id"));
    ps.setInt(1,id);
    int count = ps. executeUpdate();
    if(count >0 ){
        out. print("删除成功");
    }else{
        out . print("删除失败");

%>
</body>
</html>